<template>
	<picker :range-key="label" :range="list_demo" @change="changeDemo">
		<view class="select flex flex-y">
			{{value_demo[label]?value_demo[label]:placeholder}}
			<uni-icons class="arrowdown" type="arrowdown" color="#666" size="10"></uni-icons>
		</view>
	</picker>
</template>

<script>
export default {
	props:['label','value','array','placeholder'],
	data() {
		return {
			value_demo: "",
		}
	},
	computed:{
		list_demo(){
			return this.array
		}
	},
	onLoad() {

	},
	methods: {
		changeDemo(e){
			let n = e.detail.value;
			this.value_demo = this.list_demo[n];
			this.$emit('input',this.value_demo);
		}
	}
}
</script>

<style lang="scss" scoped>
	.select{
		color: #666;
	}
</style>
